package com.infisight.hudprojector.fragment;

import java.util.ArrayList;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Fragment;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;

import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationListener;
import com.amap.api.maps.LocationSource;
import com.amap.api.navi.view.RouteOverLay;
import com.amap.api.navi.AMapHudView;
import com.amap.api.navi.AMapNavi;
import com.amap.api.navi.AMapNaviListener;
import com.amap.api.navi.AMapNaviView;
import com.amap.api.navi.AMapNaviViewOptions;
import com.amap.api.navi.model.AMapNaviInfo;
import com.amap.api.navi.model.AMapNaviLocation;
import com.amap.api.navi.model.AMapNaviPath;
import com.amap.api.navi.model.NaviInfo;
import com.amap.api.navi.model.NaviLatLng;
import com.google.gson.Gson;
import com.infisight.hudprojector.MainActivity;
import com.infisight.hudprojector.R;
import com.infisight.hudprojector.common.HudProjectApplication;
import com.infisight.hudprojector.data.SpeechVoiceData;
import com.infisight.hudprojector.data.StartNaviInfo;
import com.infisight.hudprojector.data.VoiceDataClass;
import com.infisight.hudprojector.kdxfspeech.SpeechVoiceCompound;
import com.infisight.hudprojector.kdxfspeech.SpeechVoiceRecognition;
import com.infisight.hudprojector.service.MusicService;
import com.infisight.hudprojector.util.CommonUtil;
import com.infisight.hudprojector.util.Constants;
import com.infisight.hudprojector.util.WordDataSet;

/**
 * 显示HUD的Fragment
 * 
 * @author Administrator
 * 
 */
@SuppressLint("NewApi")
public class HudFragment extends Fragment implements AMapNaviListener,
		LocationSource, AMapLocationListener {
	protected static final String TAG = "HudFragment";
	Gson gson;
	AMapNaviView mAmapAMapNaviView;
	TextView fg_tv_next_roadname2, fg_hud_remainder_distance, fg_hud_car_speed;// 下一个道路名称
	ImageView fg_im_next_direction2, fg_hud_im_turn_back,
			fg_im_next_direction_right;// 指示标
	SpeechVoiceRecognition svr = null;
	SpeechVoiceCompound svc = null;
	View view;
	// ProgressBar fg_bar_distance2;
	Handler handle = new Handler();
	int progressDistance = 0;
	AlertDialog dialog = null;
	SharedPreferences sp;
	SeekBar seekBar;
	String newHudNaviInfo;
	boolean isEndNavi;
	// 起点终点列表
	private ArrayList<NaviLatLng> mStartPoints = new ArrayList<NaviLatLng>();
	private ArrayList<NaviLatLng> mEndPoints = new ArrayList<NaviLatLng>();
	AMapNavi mAMapNavi;
	boolean isTotalDistance = false;
	MainActivity mainActivity = null;

	// 地图相关的内容
	// AMap aMap;
	// MapView mapView;

	// WindowManager wm;
	// OnLocationChangedListener mListener;
	// LocationManagerProxy mAMapLocationManager;
	// Marker marker;// 定位雷达小图标

	/**
	 * 创建唯一实例
	 * 
	 * @return
	 */
	public HudFragment newInstance(String hudInfo) {
		HudFragment fragment = new HudFragment();
		Bundle args = new Bundle();
		args.putString("hudInfo", hudInfo);
		fragment.setArguments(args);
		return fragment;
	}

	/**
	 * 构造函数
	 */
	public HudFragment() {

	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		// 获取参数
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		mainActivity = (MainActivity) getActivity();
		mainActivity.SetLayoutGone();
		gson = new Gson();
		Log.i(TAG, "onCreateView");
		view = inflater.inflate(R.layout.fragment_hud2, container, false);

		seekBar = (SeekBar) view.findViewById(R.id.seekBar);

		fg_hud_remainder_distance = (TextView) view
				.findViewById(R.id.fg_hud_remainder_distance);

		fg_hud_car_speed = (TextView) view.findViewById(R.id.fg_hud_car_speed);
		fg_hud_car_speed.setText("100km/h");

		fg_tv_next_roadname2 = (TextView) view
				.findViewById(R.id.fg_tv_next_roadname2);

		fg_im_next_direction2 = (ImageView) view
				.findViewById(R.id.fg_im_next_direction2);

		fg_im_next_direction_right = (ImageView) view
				.findViewById(R.id.fg_im_next_direction_right);

		fg_hud_im_turn_back = (ImageView) view
				.findViewById(R.id.fg_hud_im_turn_back);

		mAmapAMapNaviView = (AMapNaviView) view
				.findViewById(R.id.extendnavimap2);

		fg_hud_im_turn_back.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				isEndNavi = true;
				CommonUtil.retHomeFragment(getActivity());
			}
		});
		return view;
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onActivityCreated(savedInstanceState);
		Log.i(TAG, "onActivityCreated");
		mAMapNavi = AMapNavi.getInstance(getActivity());
		InitView(savedInstanceState);
		svr = new SpeechVoiceRecognition(getActivity(), "", null);// 语音识别
		svc = SpeechVoiceCompound.getInstance(getActivity(), null, null);// 语音合成
		sp = getActivity().getSharedPreferences("bg_music_info", 0);
		svc.stopListen();
	}

	private void InitView(Bundle savedInstanceState) {
		Log.i("TAGs", "InitView");
		Bundle bundle = getArguments();
		if (bundle == null) {
			String gsonNavi = getActivity().getSharedPreferences(
					"StartNaviInfo", 0).getString("hud_navi_info", null);
			if (gsonNavi != null) {
				StartNaviInfo naviInfos = gson.fromJson(gsonNavi,
						StartNaviInfo.class);
				AMapNaviViewOptions viewOptions = mAmapAMapNaviView
						.getViewOptions();
				viewOptions.setLayoutVisible(false);
				viewOptions.setNaviNight(true);
				viewOptions.setNaviViewTopic(1);
				viewOptions.setReCalculateRouteForTrafficJam(true);// 道路堵塞是重新路径规划
				viewOptions.setReCalculateRouteForYaw(true);// 偏航是重新路径规划
				viewOptions.setTrafficBarEnabled(false);//
				// 返回路况光柱条是否显示（只适用于驾车导航，需要联网）。路况光柱颜色：红—拥堵；黄—缓行；绿—畅通；灰—未知。
				viewOptions.setTrafficLayerEnabled(false);// 设置实时交通图层是否显示
				//
				viewOptions
						.setLeaderLineEnabled(AMapNaviViewOptions.WHITE_COLOR_TOPIC);//
				// 牵引线
				viewOptions.setRouteListButtonShow(true);// 设置导航界面是否显示路线全览按钮。
				viewOptions.setMonitorCameraEnabled(true);// 设置摄像头监控图标是否显示
				mAmapAMapNaviView.onCreate(savedInstanceState);

				mAMapNavi.setAMapNaviListener(this);
				mAMapNavi.reCalculateRoute(naviInfos.getRoute_plan());
			}
			return;
		}
		StartNaviInfo naviInfos = (StartNaviInfo) bundle
				.getSerializable("navi_point_info");
		getActivity().getSharedPreferences("StartNaviInfo", 0).edit()
				.putString("hud_navi_info", gson.toJson(naviInfos)).commit();
		mStartPoints.add(naviInfos.getNavi_start());
		mEndPoints.add(naviInfos.getNavi_end());

		AMapNaviViewOptions viewOptions = mAmapAMapNaviView.getViewOptions();
		AMapHudView s = new AMapHudView(getActivity());
		// AMapNaviViewOptions viewOptions = new AMapNaviViewOptions();
		viewOptions.setLayoutVisible(false);
		viewOptions.setNaviNight(true);
		viewOptions.setSettingMenuEnabled(true);// 设置菜单按钮是否在导航界面显示。
		viewOptions.setNaviViewTopic(1);
		viewOptions.setReCalculateRouteForTrafficJam(true);// 道路堵塞是重新路径规划
		viewOptions.setReCalculateRouteForYaw(true);// 偏航是重新路径规划
		viewOptions.setTrafficBarEnabled(true);// 返回路况光柱条是否显示（只适用于驾车导航，需要联网）。路况光柱颜色：红—拥堵；黄—缓行；绿—畅通；灰—未知。
		viewOptions.setTrafficLayerEnabled(false);// 设置实时交通图层是否显示
		viewOptions.setLeaderLineEnabled(AMapNaviViewOptions.WHITE_COLOR_TOPIC);//
		// 牵引线
		viewOptions.setRouteListButtonShow(true);// 设置导航界面是否显示路线全览按钮。
		viewOptions.setMonitorCameraEnabled(true);// 设置摄像头监控图标是否显示
		mAmapAMapNaviView.onCreate(savedInstanceState);

		mAMapNavi.setAMapNaviListener(this);

		mAMapNavi.calculateDriveRoute(mStartPoints, mEndPoints, null,
				naviInfos.getRoute_plan());
		Log.i("TAGs",
				"InitView-----calculateDriveRoute" + naviInfos.getRoute_plan());
	}

	@Override
	public void onSaveInstanceState(Bundle outState) {
		// TODO Auto-generated method stub
		super.onSaveInstanceState(outState);
		mAmapAMapNaviView.onSaveInstanceState(outState);
	}

	@Override
	public void onPause() {
		// TODO Auto-generated method stub
		getActivity().unregisterReceiver(gHudReceiver);
		if (isEndNavi == true && mAmapAMapNaviView != null) {
			mAmapAMapNaviView.onPause();
			Log.i("TAGs", "mAmapAMapNaviView.onPause()");
		}
		super.onPause();
		// if (svc != null)
		// svc.destroy();
		Log.i("TAGs", "onPause");
	}

	@Override
	public void onResume() {
		// TODO Auto-generated method stub
		getActivity().registerReceiver(gHudReceiver, makeNewMsgIntentFilter());
		super.onResume();
		mAmapAMapNaviView.onResume();
		Log.i("TAGs", "onResume");
	}

	@Override
	public void onDestroy() {
		// TODO Auto-generated method stub
		mainActivity.SetLayoutVisible();
		if (isEndNavi == true && mAmapAMapNaviView != null) {
			mAmapAMapNaviView.onDestroy();
			isEndNavi = false;
			progressDistance = 0;
			HudProjectApplication.totalDis = 0;
			removeSp();
			mAMapNavi.removeAMapNaviListener(this);
			mAMapNavi.stopNavi();
			mAMapNavi.destroy();
			HudProjectApplication.zoom = -1000;
			HudProjectApplication.naviPath = null;
		}
		super.onDestroy();
		Log.i("TAGs", "onDestroy");

	}

	@Override
	public void onDestroyView() {
		// TODO Auto-generated method stub
		super.onDestroyView();
		Log.i(TAG, "onDestroyView");
	}

	@Override
	public void onDetach() {
		// TODO Auto-generated method stub
		super.onDetach();
		Log.i(TAG, "onDetach");
	}

	BroadcastReceiver gHudReceiver = new BroadcastReceiver() {

		@SuppressWarnings({ "null", "unused" })
		@Override
		public void onReceive(Context context, Intent intent) {
			// TODO Auto-generated method stub
			gson = new Gson();
			final String action = intent.getAction();
			Log.i(TAG, "gHudReceiver" + action);
			SpeechVoiceData svd;
			VoiceDataClass vdc = null;

			try {
				// 结束导航
				if (action != null
						&& Constants.MAIN_RETURN_HOME_ACTION.equals(action)) {
					Log.i(TAG, action + "action");
					svd = gson.fromJson(intent
							.getStringExtra(Constants.MAIN_RETURN_HOME_ACTION),
							SpeechVoiceData.class);
					vdc = gson.fromJson(svd.getValue(), VoiceDataClass.class);

					// 结束导航
					if (vdc.getType().equals(Constants.F_R_STOP_NAVI[0])) {
						isEndNavi = true;// 结束导航
						CommonUtil.retHomeFragment(getActivity());
					}
					// 返回首页
					else if (vdc.getType().equals(Constants.F_R_RETURN_HOME[0])) {
						if (mAmapAMapNaviView != null) {
							Log.i(TAG, action + "action2");
							CommonUtil.retHomeFragment(getActivity());
						}
					}
				}
				// hud界面打电话
				else if (action != null
						&& Constants.MAIN_PHONE_ACTION.equals(action)) {

					svd = gson.fromJson(
							intent.getStringExtra(Constants.MAIN_PHONE_ACTION),
							SpeechVoiceData.class);
					if (svd.getValue() != null) {
						vdc = gson.fromJson(svd.getValue(),
								VoiceDataClass.class);

						svd.setCommand(Constants.MAIN_PHONE_COM);
						svd.setValue(vdc.getValue());
						CommonUtil.processBroadcast(getActivity(), svd);
					}
				}
				// hud界面显示obd
				else if (action != null
						&& Constants.MAIN_OBD_ACTION.equals(action)) {

					svd = gson.fromJson(
							intent.getStringExtra(Constants.MAIN_OBD_ACTION),
							SpeechVoiceData.class);
					if (svd.getValue() != null) {
						vdc = gson.fromJson(svd.getValue(),
								VoiceDataClass.class);
						svd.setCommand(Constants.MAIN_OBD_COM);
						svd.setValue(vdc.getValue());
						CommonUtil.processBroadcast(getActivity(), svd);
					}

				}
				// hud音乐功能
				else if (action != null
						&& Constants.MAIN_MUSIC_ACTION.equals(action)) {
					svd = gson.fromJson(
							intent.getStringExtra(Constants.MAIN_MUSIC_ACTION),
							SpeechVoiceData.class);
					vdc = gson.fromJson(svd.getValue(), VoiceDataClass.class);
					Intent intent2 = new Intent(getActivity(),
							MusicService.class);
					// 停止播放
					if (vdc.getType().equals(Constants.F_R_MUSIC_STOP_PLAY[0])) {
						intent2.putExtra("play", "pause");
						getActivity().startService(intent2);
					}
					// 继续播放
					else if (vdc.getType().equals(
							Constants.F_R_MUSIC_CONTINUE_PLAY[0])) {
						intent2.putExtra("play", "playing");
						intent2.putExtra("id", sp.getInt("currentMusic", 0));
						getActivity().startService(intent2);
					}
					// 下一首
					else if (vdc.getType().equals(
							Constants.F_R_MUSIC_NEXT_MUSIC_PLAY[0])) {
						intent2.putExtra("play", "next");
						intent2.putExtra("id", sp.getInt("currentMusic", 0) + 1);
						getActivity().startService(intent2);
					}
					// 上一首
					else if (vdc.getType().equals(
							Constants.F_R_MUSIC_LAST_MUSIC_PLAY[0])) {
						int index = sp.getInt("currentMusic", 0) - 1;
						if (index < 0) {
							index = 0;
						}
						intent2.putExtra("play", "last");
						intent2.putExtra("id", index);
						getActivity().startService(intent2);
					} else {
						svd.setCommand(Constants.MAIN_MUSIC_COM);

						Log.i(TAG, intent
								.getStringExtra(Constants.MAIN_MUSIC_ACTION));
						CommonUtil.processBroadcast(getActivity(), svd);
					}
				}
				// hud界面导航
				else if (action != null
						&& Constants.MAIN_NAVI_ACTION.equals(action)) {
					svd = gson.fromJson(
							intent.getStringExtra(Constants.MAIN_NAVI_ACTION),
							SpeechVoiceData.class);
					if (svd.getValue() != null) {
						vdc = gson.fromJson(svd.getValue(),
								VoiceDataClass.class);
						if (vdc.getType().equals(Constants.F_R_NAV_GOTO[0])
								|| vdc.getType().equals(
										Constants.F_R_OPEN_NAVI[0])) {
							dialog = CommonUtil.isDoThisStep(getActivity(),
									"是否结束当前导航").show();
							svc.startSpeaking("是否结束当前导航");
							newHudNaviInfo = vdc.getValue();
						}
						// 结束当前导航
						else if (vdc.getType().equals(
								Constants.F_R_STOP_CURRENT_NAVI[0])) {
							if (dialog != null && dialog.isShowing()) {
								dialog.dismiss();
								dialog = null;
								isEndNavi = true;// 结束当前导航
								VoiceDataClass vdc2 = new VoiceDataClass(
										Constants.MAIN_NAVI_ACTION,
										Constants.F_R_NAV_GOTO[0],
										newHudNaviInfo,
										Constants.F_C_FOUND_RIGHT_ADDR);
								SpeechVoiceData svd2 = new SpeechVoiceData(
										Constants.MAIN_NAVI_COM,
										gson.toJson(vdc2));

								svd2.setCommand(Constants.MAIN_NAVI_COM);

								CommonUtil
										.processBroadcast(getActivity(), svd2);
							}

						}
						// 不结束当前导航
						else if (vdc.getType().equals(
								Constants.F_R_CONTINUE_CURRENT_NAVI[0])) {
							if (dialog != null && dialog.isShowing()) {
								dialog.dismiss();
								dialog = null;
							}
						}
						// 路线总览
						else if (vdc.getType().equals(
								Constants.F_R_NAVI_ROUTE_PLAN_All_SEE[0])) {
							svd.setCommand(Constants.MAIN_NAVI_COM);
							svd.setValue(gson.toJson(vdc));
							CommonUtil.processBroadcast(getActivity(), svd);
						}
					}

					// 弹框提示操作
				}
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

	};

	/**
	 * 广播过滤器
	 */
	private static IntentFilter makeNewMsgIntentFilter() {
		final IntentFilter intentFilter = new IntentFilter();
		intentFilter.addAction(Constants.MAIN_NAVI_ACTION);
		intentFilter.addAction(Constants.MAIN_OBD_ACTION);
		intentFilter.addAction(Constants.MAIN_PHONE_ACTION);
		intentFilter.addAction(Constants.MAIN_MUSIC_ACTION);
		intentFilter.addAction(Constants.MAIN_RETURN_HOME_ACTION);
		intentFilter.addAction(Constants.MODEL_PHONE_ACTION);
		intentFilter.addAction(Constants.MODEL_PHONE_NAME_ACTION);
		intentFilter.addAction(Constants.MODEL_PHONE_ITEM_CHOOSE_ACTION);
		intentFilter.addAction(Constants.COMMON_UTIL_ACTION);
		return intentFilter;
	}

	/*
	 * 清楚sp
	 */
	public void removeSp() {
		HudProjectApplication.totalDis = 0;
		getActivity().getSharedPreferences("StartNaviInfo", 0).edit().clear()
				.commit();
	}

	@Override
	public void onLocationChanged(Location location) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onStatusChanged(String provider, int status, Bundle extras) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onProviderEnabled(String provider) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onProviderDisabled(String provider) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onLocationChanged(AMapLocation arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void activate(OnLocationChangedListener arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void deactivate() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onArriveDestination() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onArrivedWayPoint(int arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onCalculateRouteFailure(int arg0) {
		// TODO Auto-generated method stub
		Log.i(TAG, "onCalculateRouteFailure" + arg0);
	}

	@Override
	public void onCalculateRouteSuccess() {
		// TODO Auto-generated method stub
		Log.i("TAGs", "onCalculateRouteSuccess");
		// 设置模拟速度
		mAMapNavi.setEmulatorNaviSpeed(100);
		// 开启模拟导航
		mAMapNavi.startNavi(AMapNavi.EmulatorNaviMode);
		AMapNaviPath naviPath = mAMapNavi.getNaviPath(); // 获取路径
		// Log.i(TAG, naviPath.toString());
		// totalDistance = naviPath.getAllLength();// 获取总距离
		// // // fg_bar_distance2.setMax(250000);
		// if (isTotalDistance == false) {
		// HudProjectApplication.totalDis = totalDistance;
		// isTotalDistance = true;
		// Log.i("TAGs", "isTotalDistance = true;");
		// } else {
		// totalDistance = HudProjectApplication.totalDis;
		// Log.i("TAGs", "isTotalDistance = false;");
		// }
		// seekBar.setMax(totalDistance);
	}

	@Override
	public void onEndEmulatorNavi() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onGetNavigationText(int arg0, String arg1) {
		// TODO Auto-generated method stub
		Log.i(TAG, arg1);
		svc.startSpeaking(arg1);
		if (arg1.contains("本次导航结束")) {
			isEndNavi = true;// 导航结束
			HudProjectApplication.zoom = -1000;
			HudProjectApplication.naviPath = null;
			// CommonUtil.retHomeFragment(getActivity());
		}

	}

	@Override
	public void onGpsOpenStatus(boolean arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onInitNaviFailure() {
		// TODO Auto-generated method stub
		Log.i(TAG, "导航创建失败");
	}

	@Override
	public void onInitNaviSuccess() {
		// TODO Auto-generated method stub
		Log.i(TAG, "导航创建成功时的回调函数");
	}

	@Override
	public void onLocationChange(AMapNaviLocation arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onNaviInfoUpdate(NaviInfo naveinfo) {
		// TODO Auto-generated method stub
		if (naveinfo == null) {
			return;
		}
		if (HudProjectApplication.totalDis == 0) {
			HudProjectApplication.totalDis = naveinfo.getPathRetainDistance();
		}
		seekBar.setMax(HudProjectApplication.totalDis);
		// 路名和指示标
		fg_tv_next_roadname2.setText(naveinfo.getNextRoadName());
		int IconType = naveinfo.getIconType();
		if (WordDataSet.hmHudInductionIcons.keySet().contains(IconType)) {
			if (WordDataSet.rightIconsLsts.contains(IconType)) {
				fg_im_next_direction_right.setVisibility(View.VISIBLE);
				fg_im_next_direction2.setVisibility(View.GONE);
				fg_im_next_direction_right
						.setBackgroundResource(WordDataSet.hmHudInductionIcons
								.get(IconType));
				fg_im_next_direction_right.refreshDrawableState();
			} else {
				fg_im_next_direction_right.setVisibility(View.GONE);
				fg_im_next_direction2.setVisibility(View.VISIBLE);
				fg_im_next_direction2
						.setBackgroundResource(WordDataSet.hmHudInductionIcons
								.get(IconType));
				fg_im_next_direction2.refreshDrawableState();
			}
		}
		Log.d(TAG,
				"总距离：" + HudProjectApplication.totalDis + "剩余距离："
						+ naveinfo.getPathRetainDistance());
		// 进度条
		progressDistance = HudProjectApplication.totalDis
				- naveinfo.getPathRetainDistance();// 所行走的距离
		// fg_bar_distance2.setProgress(progressDistance);
		seekBar.setProgress(progressDistance);

		if ((naveinfo.getPathRetainDistance() == 0)) {
			Log.d(TAG, "重新初始化-------------------------");
			progressDistance = 0;
			HudProjectApplication.totalDis = 0;
		}
		String dis = CommonUtil.meterTurnKm(naveinfo.getPathRetainDistance());
		fg_hud_remainder_distance.setText(dis);

		// sbf.append(" 下一导航点距离：");
		// sbf.append(naveinfo.getCurStepRetainDistance());
		// sbf.append(" 剩余旅程：");
		// sbf.append(naveinfo.getPathRetainDistance());
		// if (naveinfo.getCameraDistance() != -1) {
		// sbf.append(" 摄像头类型：");
		// if (naveinfo.getCameraType() == 0) {
		// sbf.append("测速");
		// }
		// if (naveinfo.getCameraType() == 1) {
		// sbf.append("监控");
		// }
		// sbf.append(" 摄像头距离：");
		// sbf.append(naveinfo.getCameraDistance());
		// }
		// sbf.append(" 当前位置前一个形状点索引：");
		// sbf.append(naveinfo.getCurPoint());
		// sbf.append(" 当前大路段索引：");
		// sbf.append(naveinfo.getCurStep());
		// sbf.append(" 当前路段剩余距离：");
		// sbf.append(naveinfo.getCurStepRetainDistance());
		// sbf.append(" 当前路段剩余时间：");
		// sbf.append(naveinfo.getCurStepRetainTime());
		// sbf.append(" 导航转向图标：");
		// sbf.append(naveinfo.getIconType());
		// sbf.append(" 电子眼限速：");
		// sbf.append(naveinfo.getLimitSpeed());
		// sbf.append(" 导航信息类型：");
		// sbf.append(naveinfo.getNaviType());
		// sbf.append(" 路线剩余距离：");
		// sbf.append(naveinfo.getPathRetainDistance());
		// sbf.append(" 路线剩余时间：");
		// sbf.append(naveinfo.getPathRetainTime());

	}

	@Override
	public void onNaviInfoUpdated(AMapNaviInfo arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onReCalculateRouteForTrafficJam() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onReCalculateRouteForYaw() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onStartNavi(int arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onTrafficStatusUpdate() {
		// TODO Auto-generated method stub

	}
}
